import { Tag } from "../system/tag/type"
import { User } from "../user/type"

export type Community = {
    id: string,
    name: string,
    title: string
    url: string,
    description: string,
    creator: string
}

export type Article = {
    id: string,
    content: string,
    tagId: string,
    communityId: string
    authorId: string,
    likeCount?: string,
    commentCount?: string,
    isLike?: boolean
}

export type ArticleVo = {
    id: string,
    content: string,
    tag: Tag,
    community: Community,
    user: User
}

export type Comment = {
    id: string,
    articleId: string,
    userId: string,
    content: string,
    likeCount: string,
    isLike: boolean,
    created: string
}

export type SecondComment = {
    id: string,
    parentCommentId: string,
    articleId: string,
    userId: string,
    content: string,
    likeCount: string,
    isLike: boolean,
    created: string | null
}

export type ArticleDetail = {
    id: string,
    tagId: string,
    communityId: string,
    content: string,
    authorId: string,
    likeCount: string,
    commentCount: string,
    isLike: boolean,
    comments: Comment[],
    secondComments: SecondComment[]
}

export type CommentPublishParams = {
    articleId: string,
    content: string
}

export type SecondCommentPublishParams = {
    parentCommentId: string,
    articleId: string,
    content: string
}